
const { http } = uni.$u

const install = (Vue, vm) => {
	// 参数配置对象
	/* const config = vm.vuex_config; */
	
	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {
		// 基础服务：登录登出、身份信息、菜单授权、切换系统、字典数据等
		/* lang: (params = {}) => vm.$u.get('/lang/'+params.lang),
		getUserInfo: (params = {}) => vm.$u.get(config.adminPath+'/mobile/user/getUserInfo', params), */
/* 		login: (params = {}) => http.post(config.adminPath+'/login', params), */
		// 获取用户信息
		getUserInfo: (params, config = {}) => http.get('/mobile/user/getUserInfo', params, config), 
        // 获取学校列表
	    getSchools: (params, config = {}) => http.get('/getSchools', params, config),
		// 
		index: (params, config = {}) => http.get('/mobile/index', params, config),
		// 登录
		login: (params, config = {}) => http.post('/login', params, config),
		getProfile: (params, config = {}) => http.get('/system/user/profile', params, config),
		
		// 个人信息修改
		user: {
			saveUserInfo: (params, config = {}) => http.post('/mobile/user/saveUserInfo', params, config),
			infoSavePwd: (params, config = {}) => http.put('/system/user/profile/updatePwd', params, config),
			infoSavePqa: (params, config = {}) => http.post('/sys/user/infoSavePqa', params, config),
		},
		// 发布通知
		publishNotice: (params, config = {}) => http.post('/system/publishNotice', params, config), 
		// 获取学生列表
		getStudentList: (params, config = {}) => http.get('/system/teacherClass/getStudentList', params, config),
		
		
		// 获取班级圈个人信息
		getPerson: (params, config = {}) => http.post('/system/classCircle/getPerson', params, config),
		// 获取班级圈信息的班级列表
		getClassList: (params, config = {}) => http.get('/system/classCircle/getClassList', params, config),
		// 获取班级圈个人信息
		getClass: (params, config = {}) => http.post('/system/classCircle/getClass', params, config),
		// 获取发布班级圈的班级列表
		getPublishClassList: (params, config = {}) => http.post('/system/class/getClassListByUerid', params, config),
		// 发布班级圈
		publishClass: (params, config = {}) => http.post('/system/classCircle', params, config), 
		
		// 通知详情
		getNoticeContext: (params, config = {}) => http.post('/system/uiContext/getNoticeContext', params, config), 
		// 收到通知
		receiveNotice: (params, config = {}) => http.post('/system/uiContext/receiveNotice', params, config), 
		// 成绩详情
		getScoreByScoreExtId: (params, config = {}) => http.post('/system/uiContext/getScoreByScoreExtId', params, config), 
	};
	
}

export default {
	install
}